<template>
  <div v-if="visible" class="dialog_overlay">
    <div class="dialog_box">
      <h3 class="dialog_title">抽签成功!</h3>
      <p class="dialog_text">您的参赛编号是：</p>
      <p class="dialog_number">{{ numberStr }}</p>

      <button class="dialog_btn" @click="$emit('close')">知道了</button>
    </div>
  </div>
</template>

<script setup>
defineProps({
  visible: Boolean, // 控制弹框显示/隐藏
  title: String,
  numberStr: String, // 参赛编号
});

defineEmits(["close"]); // 点击按钮关闭弹框
</script>

<style scoped>
/* 遮罩层 */
.dialog_overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* 弹框主体 */
.dialog_box {
  background: #fff;
  border-radius: 0.1rem;
  padding: 0.48rem 0.48rem;
  text-align: center;
  width: 5.04rem;
  max-width: 5.04rem;
}

.dialog_title {
  font-size: 0.34rem; /* 字体大小 */
  font-weight: 400;
  color: #333; /* 颜色 */
  text-align: center;
  line-height: 0.4rem;
  margin-bottom: 0.32rem;
}

.dialog_text {
  font-size: 0.28rem;
  color: #666;
  line-height: 0.4rem;
  margin-bottom: 0.14rem;
}

.dialog_number {
  font-size: 0.32rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.48rem;
}

.dialog_btn {
  width: 100%;
  height: 0.68rem;
  background: #2468f2;
  color: #fff;
  border: none;
  border-radius: 0.32rem;
  font-size: 0.28rem;
  cursor: pointer;
}

.dialog_btn:active {
  background: #1d54c9;
}
</style>
